<script type="text/javascript" src="../js/funcs.js"></script>
<?php
    require ('/connect.php');
    $query="SELECT  ch.rid as rid, r.room_number as choice, rr.text as rcr, b.building_name as bn
                FROM user as u, rooms as r, rcrinfo as rr, buildings as b, choices as ch
                WHERE  u.sid=$id AND u.SID=ch.SID AND ch.rid=r.rid AND r.bid=b.bid AND r.rcr=rr.rcid;";
    $result=mysqli_query($con, $query);
    $size=20;
    echo "<div class='roomTable styled'>
        <table><th>Your Current Room Choices</th>";
    while ($row= mysqli_fetch_assoc($result)){
            $r= $row['choice'];
            $rB = $row['bn'];
            $rRCR=$row['rcr']; 
            $rid=$row['rid'];
            echo "<tr class='row'><td>$r $rB<a href=\"#\" onclick=\"removeRoom($rid);\">
              <img src='../images/delete.png' width='".$size."px' height='".$size."px'></a></td></tr>
                    <tr class='row'><td style='text-align:center'>$rRCR</td></tr>";
    }
   echo "</table></div>";
    mysqli_close($con);
?>